let arr = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
function clock() {

    let date = new Date();
    let year = date.getFullYear();
    let month = (date.getMonth() + 1 + '').padStart(2, '0');
    let day = (date.getDate() + '').padStart(2, '0');
    let week = date.getDay();
    let hour = (date.getHours() + '').padStart(2, '0');
    let minute = (date.getMinutes() + '').padStart(2, '0');
    let second = (date.getSeconds() + '').padStart(2, '0');
    let apm = 'AM';
    if (hour > 12) {
        hour = hour - 12;
        apm = 'PM';
    }
    let str = year + '年' + month + '月' + day + '日' + ' ' + hour + ':' + minute + ':' + second + apm + '&nbsp;&nbsp;&nbsp;' + arr[week];
    console.log(str);
    app.innerHTML = str;
    return str;

}
setInterval(function () {
    clock();
}, 1000);
